﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ MasterType VirtualPath="~/Main.master" %>
<%@ Reference VirtualPath="~/Main.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CustomJavascript" runat="Server">
    <!-- fancybox stylesheet -->
    <link href="/css/jquery.fancybox-1.3.4.css" media="screen" rel="stylesheet" type="text/css" />
    <!-- fancybox -->
    <script src="/js/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#flash").show(400).delay(3000).fadeOut(1000);

            // pop up quick overview using fancy box
            $(".bug-lightbox").fancybox({
                'titleShow': false,
                'transitionIn': 'fade',
                'transitionOut': 'none',
                'type': 'iframe',
                'autoDimensions': true,
                'autoScale': true,
                'height': '800'
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FlashMessage" runat="Server">
    <asp:Literal ID="ltrFlashMessage" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div id="tabs-tickets" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
        <div id="tabs_ticket_panel">
            <!-- right tab -->
            <div id="right_tabs_ticket_panel" class="cols_no_height cols_100_height interaction_panel right_col_no_bottom" style="">
                <div style="display: block;" id="right_tabs_ticket_panel_data">
                    <div class="toolbar_ticket_filter">
                        <div id="ticket_filter_toolbar_ticket_data" class="ticket_filter_toolbar_inside" style="padding-top: 13px; padding-left: 10px;">
                            <div class="input" style="float: right; margin-right: 5px;">
                                Project:
                                <asp:DropDownList ID="ddlProjectName" runat="server" CssClass="default m" Style="margin-right: 30px; width: 250px" AutoPostBack="True" OnSelectedIndexChanged="ddlProjectName_SelectedIndexChanged">
                                </asp:DropDownList>
                                Sort by:
                                <asp:DropDownList ID="ddlSort" runat="server" CssClass="default m" Style="padding-right: 0px; width: 150px" AutoPostBack="True" OnSelectedIndexChanged="ddlSort_SelectedIndexChanged">
                                    <asp:ListItem Value="Type">Bug Type</asp:ListItem>
                                    <asp:ListItem Value="ID">Bug ID</asp:ListItem>
                                    <asp:ListItem Value="Severity">Severity</asp:ListItem>
                                    <asp:ListItem Value="SeverityD">Severity (Descending)</asp:ListItem>
                                    <asp:ListItem Value="Reproducability">Reproducability</asp:ListItem>
                                    <asp:ListItem Value="ReproducabilityD">Reproduc (Desc.)</asp:ListItem>
                                    <asp:ListItem Value="Status">Status</asp:ListItem>
                                    <asp:ListItem Value="StatusD">Status (Descending)</asp:ListItem>
                                    <asp:ListItem Value="Priority">Priority</asp:ListItem>
                                    <asp:ListItem Value="PriorityD">Priority (Descending)</asp:ListItem>
                                    <asp:ListItem Value="Modified">Modified</asp:ListItem>
                                    <asp:ListItem Value="ModifiedD" Selected="True">Modified (Descending)</asp:ListItem>
                                    <asp:ListItem Value="Version">Version</asp:ListItem>
                                    <asp:ListItem Value="VersionD">Version (Descending)</asp:ListItem>
                                </asp:DropDownList>
                            </div>
                            <span class="ticket_filter_expand_button blue_button" id="ticket_filter_expand_button" style="display: none; float: left; margin-right: 10px;">
                                <img alt="" src="images/right_double_arrow.png" style="vertical-align: text-bottom;" height="15" width="20" />
                            </span><span class="ticket_filter_toolbar_status_section ticket_filter_grouping_icon_ticket_type ticket_filter_grouping_icon_new_case tooltip_ticket_filter_item_toolbar ticket_filter_grouping_icon_new_case_disabled" style="padding-left: 0; min-width: 30px;"><span class="ticket_filter_item_count" id="ticket_filter_new_case_count">10</span>
                                <br />
                                <span class="ticket_filter_item_helper">New</span></span><span class="ticket_filter_toolbar_status_section ticket_filter_grouping_icon_ticket_type ticket_filter_grouping_icon_open_case tooltip_ticket_filter_item_toolbar" style="padding-left: 0; min-width: 30px;"><span class="ticket_filter_item_count" id="ticket_filter_open_case_count">12</span>
                                    <br />
                                    <span class="ticket_filter_item_helper">Conf.</span></span><span class="ticket_filter_toolbar_status_section ticket_filter_grouping_icon_ticket_type ticket_filter_grouping_icon_pending_case tooltip_ticket_filter_item_toolbar ticket_filter_grouping_icon_pending_case_disabled" style="padding-left: 0; min-width: 30px;"><span class="ticket_filter_item_count" id="ticket_filter_pending_case_count">8</span>
                                        <br />
                                        <span class="ticket_filter_item_helper">Fixed</span></span><span class="ticket_filter_toolbar_status_section ticket_filter_grouping_icon_ticket_type ticket_filter_grouping_icon_resolved_case tooltip_ticket_filter_item_toolbar ticket_filter_grouping_icon_resolved_case_disabled" style="padding-left: 0; min-width: 30px;"><span class="ticket_filter_item_count" id="ticket_filter_resolved_case_count">11</span>
                                            <br />
                                            <span class="ticket_filter_item_helper">Reop.</span></span><span class="ticket_filter_toolbar_status_section ticket_filter_grouping_icon_ticket_type ticket_filter_grouping_icon_closed_case tooltip_ticket_filter_item_toolbar ticket_filter_grouping_icon_closed_case_disabled" style="padding-left: 0; min-width: 30px;"><span class="ticket_filter_item_count" id="ticket_filter_closed_case_count">10</span>
                                                <br />
                                                <span class="ticket_filter_item_helper">Closed</span></span>
                        </div>
                    </div>
                    <asp:ListView ID="lvView" runat="server" DataSourceID="LinqDataSource1">
                        <EmptyDataTemplate>
                            <p style="margin-left: 10px;">Relax now, no bugs found!</p>
                        </EmptyDataTemplate>
                        <LayoutTemplate>
                            <div id="ticket_filter_list_header" class="ticket_filter_list_header">
                                <span class="ticket_filter_item_tv_type" style=""></span><span class="ticket_filter_item_tv_customer_name">ID </span><span class="ticket_filter_item_tv_subject">Summary </span><span class="ticket_filter_item_tv_message_count scrollbar_mover">
                                    <img alt="" class="agent_icon_button" src="/images/refresh.png" />
                                </span><span class="ticket_filter_item_tv_status scrollbar_mover">Status </span><span class="ticket_filter_item_tv_priority scrollbar_mover">
                                    <img alt="" class="agent_icon_button" src="/images/label.png" style="margin-left: 2px;" />
                                </span><span class="ticket_filter_item_tv_updated scrollbar_mover">Updated </span><span class="ticket_filter_item_tv_assigned scrollbar_mover">Version </span><span class="ticket_filter_item_tv_actions scrollbar_mover">Actions </span>
                            </div>
                            <div id="ticket_filter_list_items_outer_div" class="ticket_filter_list_items table_view">
                                <div id="ticket_filter_list_items_data_div">
                                    <div id="ticket_filter_list_items">
                                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                                    </div>
                                    <div id="ticket_filter_item_paginator">
                                        Page
                                        <asp:DataPager ID="DataPager" PageSize="10" runat="server">
                                            <Fields>
                                                <asp:NumericPagerField ButtonCount="10" PreviousPageText="«" NextPageText="»" />
                                            </Fields>
                                        </asp:DataPager>
                                    </div>
                                </div>
                            </div>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <!-- first item, selected -->
                            <div class="ticket_filter_item ticket_filter_item_table_view">
                                <!-- bug type image -->
                                <span class="ticket_filter_item_tv_type">
                                    <img alt="" title="<%# EnumUtility.GetEnumNiceName((BugManagement.Type)Eval("Type")) %>" class="agent_icon_button vtip" src="/images/bug/type/<%# Eval("Type") %>.png" />
                                </span>
                                <!-- bug ID -->
                                <div class="ticket_filter_item_tv_customer_name">
                                    <a href="/Bug.aspx?id=<%# Eval("BugId") %>" title="Click to view bug details">
                                        <%# Eval("BugId") %>
                                    </a>
                                </div>
                                <!-- bug severity -->
                                <div class="ticket_filter_item_tv_subject">
                                    <div class="ticket_filter_item_data ticket_filter_item_tv_labels">
                                        <ul class="token-input-list-facebook bug-severity">
                                            <li class="token-input-token-facebook bug-severity-<%# EnumUtility.GetEnumNiceName((BugManagement.Severity)Eval("Severity")) %>">
                                                <p title="Severity level of this bug">
                                                    <%# EnumUtility.GetEnumNiceName((BugManagement.Severity)Eval("Severity")) %>
                                                </p>
                                            </li>
                                        </ul>
                                    </div>
                                    <!-- bug summary -->
                                    <a href="#" class="vtip" title="<%# Eval("Description") %>">
                                        <%# Eval("Summary").ToString().Length < 100 ? Eval("Summary") : Eval("Summary").ToString().Substring(0, 99) %>
                                    </a>
                                </div>
                                <!-- comment count -->
                                <span class="lesser_data ticket_filter_item_tv_message_count">
                                    <img alt="" title="Reproducability: <%# EnumUtility.GetEnumNiceName((BugManagement.Reproducability)Eval("Reproducability")) %>" class="agent_icon_button vtip" src="/images/bug/repro/<%# Eval("Reproducability") %>.png" />
                                </span>
                                <!-- status -->
                                <span class="lesser_data ticket_filter_item_tv_status" style="margin-top: 1px"><span class="ticket_filter_item_status_box bug_status_<%# EnumUtility.GetEnumNiceName((BugManagement.ShortStatus)Eval("Status"))%>"><span class="ticket_filter_item_data">
                                    <%# EnumUtility.GetEnumNiceName((BugManagement.ShortStatus)Eval("Status")) %>
                                </span></span></span>
                                <!-- priority -->
                                <span class="lesser_data ticket_filter_item_tv_priority"><span style="float: right; margin-top: 0;">
                                    <img alt="" title="Priority: <%# EnumUtility.GetEnumNiceName((BugManagement.Priority)Eval("Priority")) %>" class="agent_icon_button vtip" src="/images/bug/priority/<%# Eval("Priority") %>.png" style="margin-top: -3px; margin-right: 0pt;" height="16" width="16" />
                                </span></span>
                                <!-- last updated -->
                                <span class="lesser_data ticket_filter_item_time ticket_filter_item_tv_updated">
                                    <%# (DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).TotalHours > 24 ? ((DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Days == 1 ? "1 day ago" : (DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Days.ToString() + " days ago") : ((DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Hours == 1 ? "1 hour ago" : (DateTime.Now - (DateTime)(Eval("LastUpdatedDate"))).Hours.ToString() + " hours ago") %>
                                </span>
                                <!-- version -->
                                <span class="lesser_data ticket_filter_item_tv_assigned">
                                    <%# Eval("BugFoundInVersion")%>
                                </span>
                                <!-- actions -->
                                <span class="ticket_filter_item_tv_actions" style="margin-top: 2px;"><a title="Open In New Window" class="ticket_filter_item_tv_tip_open ticket_filter_action_open" href="/Bug.aspx?id=<%# Eval("BugId") %>" target="_blank">
                                    <img alt="" class="agent_icon_button" src="/images/open.png" height="16" width="16" /></a> <a title="Quick View" class="ticket_filter_item_tv_tip_view bug-lightbox" href="Bug.aspx?id=<%# Eval("BugId") %>#bug-small-details">
                                        <img alt="" class="agent_icon_button" src="/images/view.png" height="16" width="16" /></a> <a title="Resolve" class="ticket_filter_item_tv_tip_resolve" href="#ajax-frame" onclick="$('#ajax-frame').load('/BugCheck.aspx?id=<%# Eval("BugId") %> #bug-small-details');">
                                            <img alt="" class="agent_icon_button" src="/images/quick_resolve.png" height="16" width="16" /></a> </span>
                            </div>
                        </ItemTemplate>
                    </asp:ListView>
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="KillDaBugsDataContext" EntityTypeName="" Select="new (Type, BugId, Severity, Summary, Status, Reproducability, Priority, LastUpdatedDate, BugFoundInVersion, Description)" TableName="Bugs" OrderBy="LastUpdatedDate desc" Where="ProjectId == @ProjectId">
                        <WhereParameters>
                            <asp:ControlParameter ControlID="ddlProjectName" Name="ProjectId" PropertyName="SelectedValue" Type="Int32" />
                        </WhereParameters>
                    </asp:LinqDataSource>
                </div>
            </div>
            <!-- left tab -->
            <div id="left_tabs_ticket_panel" class="cols interaction_panel left_col" style="background: #fff;">
                <div id="left_tabs_ticket_panel_data">
                    <div class="toolbar_ticket_filter">
                        <div class="ticket_filter_left_toolbar_inside">
                            <span class="ticket_filter_collapse_button blue_button" id="ticket_filter_collapse_button">
                                <img alt="" src="images/left_double_arrow.png" style="vertical-align: text-bottom;" height="15" width="20" />
                            </span>
                            <div class="ticket_filter_row_name row_name">
                                Bug Filters
                            </div>
                            <div class="ticket_filter_row_desc row_desc">
                                Quickly View Your Bugs
                            </div>
                        </div>
                    </div>
                    <!-- this div is to give the extra 1 pixel border-->
                    <div class="toolbar_extra_line">
                    </div>
                    <div class="toolbar_ticket_filter_list_container">
                        <div class="toolbar_ticket_filter_list" style="padding: 0;">
                            <div class="ticket_filter_row ticket_filter_highlight">
                                <div class="ticket_filter_row_name">
                                    <a href="#">Available Cases</a> (2)
                                </div>
                                <div class="ticket_filter_row_desc row_desc">
                                    All cases that are assigned to you or your groups with a status of 'New' or 'Open'
                                </div>
                            </div>
                            <div class="ticket_filter_row">
                                <div class="ticket_filter_row_name">
                                    <a href="#">My Active Cases</a> (2)
                                </div>
                                <div class="ticket_filter_row_desc row_desc">
                                    All cases assigned to you with a status of 'New' or 'Open'
                                </div>
                            </div>
                            <div class="ticket_filter_row ticket_filter_row_empty">
                                <div class="ticket_filter_row_name">
                                    <a href="#" onclick="return false;">My Pending Cases</a> (0)
                                </div>
                                <div class="ticket_filter_row_desc row_desc">
                                    All cases assigned to you with a status of 'Pending'
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="hide">
        <iframe id="ajax-frame" scrolling="auto" frameborder="0"></iframe>
    </div>
</asp:Content>